import {
  Button,
  Form,
  Input,
  message,
  Modal,
  Popover,
  Radio,
  Table,
  Select,
  Space,
  ConfigProvider,
  Watermark,
} from "antd";
import zhCN from "antd/locale/zh_CN";
import { useEffect, useState } from "react";

// 导入APi
import userApi from "../../api/UserApi";
const Blog = () => {
  const { Column } = Table;
  const [params, setParams] = useState({
    current: 1,
    size: 10,
    name: "",
    code: "",
  });
  const [blogList, setBlogList] = useState([]);
  const [total, setTotal] = useState(0);
  useEffect(() => {
    getBlogList();
  }, [params]); //监听搜索参数的变化，如果变化了，就重新获取数据
  const getBlogList = async () => {
    // const { data } = await userApi.getUserList(params);
    // setTotal(data.data.total);
    // setBlogList(data.data.records);
    const total=2
    const records=[
      {name:'陆琪',id:'1',username:'lq',code:'01'},
      {name:'赵云龙',id:'2',username:'zyl',code:'02'},
    ]
    setTotal(total);
    setBlogList(records);
  };
  const handlePaginationChange = (newPageNum, newPageSize) => {
    setParams({
      ...params,
      current: newPageNum,
      size: newPageSize,
      name: "",
      code: "",
    });
  };
const flag=true
  // 展示总条数
  const showTotal = (total) => {
    return `共 ${total} 条`;
  };
const data=[
  {name:'李子',ide:'1'},
  {name:'苹果',ide:'2'},
]
  return (
    <div>
      {/* 操作栏 */}
      <div style={{color:'red'}} className="title">{flag?'11':'22'}</div>
      <ul>
        {data.map((item,index)=>{
          return  <li key={item.id}>
                   <span>{index+1}:</span>
                   <span>{item.name}</span>
                  </li>
        })}
      </ul>
      <br />
        {new Array(5).fill(null).map((_,index)=>{
          return  <Button key={index}>
                   按钮{index}
                  </Button>
        })}
    </div>
  );
};

export default Blog;
